EVPATH = /home/jli351/evpath
VSCOPE = /home/jli351/VersaScope
CC = g++
CFLAGS = -g -O0 -Wall -I.
EXECTUABLE = vnode DPGmanager
OBJECTS = versa_util.o vnode.o vnode DPGmanager.o cluster.o DPGmanager 
#OBJECTS = versa_util.o vnode.o DPGmanager.o cluster.o
INCLUDE = $(EVPATH)/include
LD_LIBRARY_PATH = $(EVPATH)/lib  
#L = -levpath -lpthread -lffs -lcod -lm
L = -levpath -lpthread -lffs -ldill -lcercs_env -latl -lgen_thread -lm

#all: $(OBJECTS)
all: $(EXECTUABLE)
vnode: vnode.o versa_util.o
	$(CC) -L$(EVPATH)/lib -o $(VSCOPE)/bin/vnode vnode.o versa_util.o $(L)

DPGmanager: DPGmanager.o versa_util.o cluster.o
	$(CC) -L $(LD_LIBRARY_PATH) -o $(VSCOPE)/bin/DPGmanager DPGmanager.o versa_util.o cluster.o $(L)

versa_util.o: versa_util.cpp
	$(CC) -c $(CFLAGS) -I $(INCLUDE) versa_util.cpp

DPGmanager.o: DPGmanager.cpp
	$(CC) -c $(CFLAGS) -I $(INCLUDE) DPGmanager.cpp

vnode.o: vnode.cpp
	$(CC) -c $(CFLAGS) -I $(INCLUDE) vnode.cpp cluster.cpp

cluster.o: cluster.cpp
	$(CC) -c $(CFLAGS) -I $(INCLUDE) cluster.cpp

clean:
	rm -rf *o $(VSCOPE)/bin/versa_util $(VSCOPE)/bin/vnode $(VSCOPE)/bin/DPGmanager

%.o : $.c
	$(CC) $(CFLAGS) -c $<
